package test.rftennis.dao;


import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;


import com.rftennis.dao.OrderDao;

import com.rftennis.entity.OrderEntity;
import com.rftennis.entity.OrderItemEntity;
@SpringJUnitConfig(locations ="classpath:/spring.xml")
public class testOrderDao {
	@Autowired
	OrderDao dao;
	

	@Test
	public void testupdate() throws Exception {
		
		
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("status", "1");
		

		dao.update("1", map);
	}
	@Test
	public void testselect() throws Exception {
		OrderEntity o=dao.select("ord_No", "201904241115328840001");
		System.out.println(o.toString());
	}
	@Test
	public void testdelete() throws Exception{
		dao.delete("9c69c4088e089abb4734bf6d895c9cc4");
	}
	@Test
	public void testselectIDkey() throws Exception{
		String key="%2019%";
		List<OrderEntity>ru=dao.selectByIdKey("1", key);
		for(int i = 0 ; i < ru.size() ; i++) {
			  System.out.println(ru.get(i));
			}
	}
	@Test
	public void testselectkey() throws Exception{
		String key="%%";
		List<OrderEntity>ru=dao.selectByKey(key);
		for(int i = 0 ; i < ru.size() ; i++) {
			System.out.println(ru.get(i));
		}
	}
}	
